Fix parse of $GPGSA,A,*03
authorRobert Lipe <robertlipe@gpsbabel.org>
Wed, 17 May 2017 16:51:01 +0000 (11:51 -0500)
committerRobert Lipe <robertlipe@gpsbabel.org>
Wed, 17 May 2017 16:51:01 +0000 (11:51 -0500)
nmea.cc

diff --git a/nmea.cc b/nmea.cc
index e259d2f577717e053c351f30dded979bc9303041..6d8a98a10b5883344251433e2ee6267690f12161 100644 (file)
--- a/nmea.cc
+++ b/nmea.cc
@@ -701,9 +701,10 @@ gpgsa_parse(char* ibuf)
   if (nfields > 1) {
     fix = fields[2][0];
   }
+
   // 12 fields, index 3 through 14. 
   for (int cnt = 0; cnt <= 11; cnt++) {
-    if (nfields >= cnt + 2) prn[cnt] = fields[cnt + 3].toInt();
+    if (nfields > cnt + 3) prn[cnt] = fields[cnt + 3].toInt();
   }
 
   float pdop = 0, hdop = 0, vdop = 0;